package com.chtwm.yfsb.wangyi.config;

import com.chtwm.yfsb.wangyi.util.ApplicationContextUtil;
import com.chtwm.yfsb.wangyi.util.DynamicDataSourceRegisterUtil;
import org.springframework.context.EnvironmentAware;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class DynamicDataSourceRegister implements EnvironmentAware {
    @Resource
    ApplicationContextUtil applicationContextUtil;
    public void setEnvironment(Environment environment) {
        DynamicDataSourceRegisterUtil.initAndRegisterDataSource(environment);
    }
}
